//////////////////////////////////////////////////////////////////////////

#ifndef _SETTINGSMENU_H_
#include "settingsmenu.h"
#endif

//////////////////////////////////////////////////////////////////////////

#ifndef _CONTROL_H_
#include "control.h"
#endif

#ifndef _BUTTON_H_
#include "button.h"
#endif

#ifndef _EDIT_H_
#include "edit.h"
#endif

#ifndef _SURFACE_H_
#include "surface.h"
#endif

//////////////////////////////////////////////////////////////////////////


GUI_SettingsMenu::GUI_SettingsMenu()
{
    m_Buffer = 0;
    m_Controls.resize(GUI_SettingsMenu::ButtonCount);
    m_Labels.resize(GUI_SettingsMenu::LabelCount);
    m_FocusedControl = -1;

    m_Labels[GUI_SettingsMenu::Settings] = new GUI_Button(GUI_Images::Empty, GUI_Fonts::CaptionText, GUI_Colors::ButtonText, "Settings", GUI_Images::Empty, 0.1f, 0.3f, GUI_Surface::AllignLeft, 0.01f, 0.0f);

    m_Labels[GUI_SettingsMenu::Resolution] = new GUI_Button(GUI_Images::Empty, GUI_Fonts::ButtonText, GUI_Colors::ButtonText, "Resolution", GUI_Images::Empty, 0.1f, 0.5f, GUI_Surface::AllignLeft, 0.01f, 0.0f);

    m_Controls[GUI_SettingsMenu::PreviousScreenResolution] = new GUI_Button(GUI_Images::ButtonLeft, GUI_Fonts::ButtonText, GUI_Colors::ButtonText, "", GUI_Images::ButtonLeftHover, 0.4f, 0.5f);
    m_Labels[GUI_SettingsMenu::ResolutionValue] = new GUI_Button(GUI_Images::Empty, GUI_Fonts::ButtonText, GUI_Colors::ButtonText, "current", GUI_Images::Empty, 0.5f, 0.5f);
    m_Controls[GUI_SettingsMenu::NextScreenResolution] = new GUI_Button(GUI_Images::ButtonRight, GUI_Fonts::ButtonText, GUI_Colors::ButtonText, "", GUI_Images::ButtonRightHover, 0.6f, 0.5f);

    m_Labels[GUI_SettingsMenu::FullscreenMode] = new GUI_Button(GUI_Images::Empty, GUI_Fonts::ButtonText, GUI_Colors::ButtonText, "Fullscreen mode", GUI_Images::Empty, 0.1f, 0.6f, GUI_Surface::AllignLeft, 0.01f, 0.0f);

    m_Controls[GUI_SettingsMenu::PreviousFullscreenMode] = new GUI_Button(GUI_Images::ButtonLeft, GUI_Fonts::ButtonText, GUI_Colors::ButtonText, "", GUI_Images::ButtonLeftHover, 0.4f, 0.6f);
    m_Labels[GUI_SettingsMenu::FullscreenModeValue] = new GUI_Button(GUI_Images::Empty, GUI_Fonts::ButtonText, GUI_Colors::ButtonText, "current", GUI_Images::Empty, 0.5f, 0.6f);
    m_Controls[GUI_SettingsMenu::NextFullscreenMode] = new GUI_Button(GUI_Images::ButtonRight, GUI_Fonts::ButtonText, GUI_Colors::ButtonText, "", GUI_Images::ButtonRightHover, 0.6f, 0.6f);

    m_Controls[GUI_SettingsMenu::Apply] = new GUI_Button(GUI_Images::ButtonGreen, GUI_Fonts::ButtonText, GUI_Colors::ButtonText, "Apply", GUI_Images::ButtonGreenHover, 0.2f, 0.7f);
    m_Controls[GUI_SettingsMenu::Cancel] = new GUI_Button(GUI_Images::ButtonRed, GUI_Fonts::ButtonText, GUI_Colors::ButtonText, "Canel", GUI_Images::ButtonRedHover, 0.2f, 0.8f);

}


//////////////////////////////////////////////////////////////////////////


//void GUI_SettingsMenu::SetResolutionValue(const std::string& _text)
//{
//    ((GUI_Button *)m_Labels[GUI_SettingsMenu::ResolutionValue])->SetText(_text);
//}


//////////////////////////////////////////////////////////////////////////


//void GUI_SettingsMenu::SetFullscreenValue(const std::string& _text)
//{
//    ((GUI_Button *)m_Labels[GUI_SettingsMenu::FullscreenModeValue])->SetText(_text);
//}


//////////////////////////////////////////////////////////////////////////


GUI_SettingsMenu::~GUI_SettingsMenu()
{
    for (int i = 0; i < m_Controls.size(); ++i)
        delete m_Controls[i];
    for (int i = 0; i < m_Labels.size(); ++i)
        delete m_Labels[i];
}


////////////////////////////////////////////////////////////////////////////
